//接口地址统一管理
// 请求 登录/查询
import qs from 'qs'
import request from "./request";
// 请求精品数据
export const JingpinAPI = () => request.get("/products/recommend")
export const ReMenAPI = () => request.get("/products/hot")

//发生验证码
export const SendsMsAPI = (parmas) => request.post("/sendSMS", qs.stringify(parmas))
// ?phonenumber=xxx& {phone:xxx}
// 手机验证码登录接口
export const PhoneReginAPI = (parmas) => request.post("/phoneRegin", qs.stringify(parmas))
// console.log("转换后",qs.stringify({a:10,b:200}));
// 扫码登录
export const WeiXinLoginAPI = (params) => request.post('/wechatUsers/PCLogin', qs.stringify(params));
// 手机号验证码登录
export const BindPhoneAPI = (params) => request.post('/wechatUsers/binding', qs.stringify(params));
//获取用户信息
export const UserProFilesAPI = () => request.get("/shop/userProfiles");
export const GoodDetailsAPI = (id) => request.get(`/products/${id}`);
// 加入购物车
export const AddToCart = (params) => request.post('/shop/carts/add', qs.stringify(params));
//更多
export const GoodsSearchAPI = (params) => request.get("/products", { params })//{params:params}
// 请求购物车数据
export const CartDataAPI = () => request.get(`/shop/carts`);
///请求删除购物车商品
export const RemoveCartAPI = (params) => request.delete(`/shop/carts?productIds=${params.id}`);